<!DOCTYPE html>
<html>
<head>
    <title>单位管理</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16">
            <div class="search-group">
                <i-button type="ghost" @click="reload"><i class="fa fa-refresh"></i>&nbsp;刷新</i-button>
            </div>
            <div class="buttons-group">
                #if($shiro.hasPermission("sys:unit:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("sys:unit:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("sys:unit:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="dept" :rules="ruleValidate" :label-width="120">
            <Form-item label="店铺名称" prop="name">
                <i-input v-model="dept.name" placeholder="店铺名称"/>
            </Form-item>
            <Form-item label="店铺地址" prop="address">
                <i-input v-model="dept.address" placeholder="店铺地址"/>
            </Form-item>


            <Row>
                <i-col span="12">
                    <Form-item label="店铺头像" prop="icon">
                        <i-input v-model="dept.icon" placeholder="店铺头像" readonly/>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
                                max-size="1024"
                                :on-success="handleSuccessIcon" :on-format-error="handleFormatError"
                                :show-upload-list="false"
                                :on-exceeded-size="handleMaxSize">
                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
                        </Upload>
                    </Form-item>
                </i-col>
                <i-col span="2">
                    <Form-item :label-width="1">
                        <i-button icon="eye" @click="eyeImageIcon">预览图片</i-button>
                    </Form-item>
                </i-col>
                <i-col span="5">

                </i-col>
            </Row>
            <!--
            <Form-item label="单位全称" prop="longName">
                <i-input v-model="dept.longName" placeholder="单位全称"/>
            </Form-item>
            <Form-item label="单位传真" prop="fax">
                <i-input v-model="dept.fax" placeholder="单位传真"/>
            </Form-item>
            <Form-item label="单位QQ" prop="qq">
                <i-input v-model="dept.qq" placeholder="单位QQ"/>
            </Form-item>
            <Form-item label="单位地区" prop="area">
                <i-input v-model="dept.area" placeholder="单位地区"/>
            </Form-item>
            <Form-item label="单位主营" prop="mainBuss">
                <i-input v-model="dept.mainBuss" placeholder="单位主营"/>
            </Form-item>
            <Form-item label="单位地区" prop="mainBuss">
                <i-input v-model="dept.area" placeholder="单位地区"/>
            </Form-item>
            -->
            <Form-item label="手机" prop="mobile">
                <i-input v-model="dept.mobile" placeholder="手机"/>
            </Form-item>
            <Form-item label="电话" prop="telephone">
                <i-input v-model="dept.telephone" placeholder="电话"/>
            </Form-item>
            <Form-item label="微信" prop="wechat">
                <i-input v-model="dept.wechat" placeholder="微信"/>
            </Form-item>
            <Form-item label="邮箱" prop="email">
                <i-input v-model="dept.email" placeholder="邮箱"/>
            </Form-item>
            <Row>
                <i-col span="12">
                    <Form-item label="小程序背景图片" prop="appBgImageUrl">
                        <i-input v-model="dept.appBgImageUrl" placeholder="小程序首页背景图片路径" readonly/>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
                                max-size="1024"
                                :on-success="handleSuccess" :on-format-error="handleFormatError"
                                :show-upload-list="false"
                                :on-exceeded-size="handleMaxSize">
                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
                        </Upload>
                    </Form-item>
                </i-col>
                <i-col span="2">
                    <Form-item :label-width="1">
                        <i-button icon="eye" @click="eyeImage">预览图片</i-button>
                    </Form-item>
                </i-col>
                <i-col span="5">
                    注意：背景图片要求宽度为750px，高度为210px。
                </i-col>
            </Row>
            <Form-item label="小程序背景色" prop="appBgColor">
                <i-input v-model="dept.appBgColor" placeholder="小程序首页背景色"/>
            </Form-item>
            <Form-item label="小程序字体色" prop="appFontColor">
                <i-input v-model="dept.appFontColor" placeholder="小程序首页标题字体颜色"/>
            </Form-item>
            <Form-item label="代理协议" prop="proxyAgreement">
                <!--<i-input v-model="dept.proxyAgreement" placeholder="代理协议"/>-->
                <textarea v-model="dept.proxyAgreement" placeholder="代理协议" rows="5" cols="150"></textarea>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px">返回</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>

<script src="${rc.contextPath}/js/sys/unit.js?_${date.systemTime}"></script>
</body>
</html>